﻿
Imports System.Net
Imports System.Net.Sockets

Public Class tcpListener2
    Inherits TcpListener

#If NOT_IN_USE Then
    Private Sub disableIpV6Only()
        Try
            Server.SetSocketOption(SocketOptionLevel.IPv6, CType(27, SocketOptionName), 0)
        Catch
        End Try
    End Sub

    Public Sub New(ByVal localEP As IPEndPoint)
        MyBase.New(localEP)
        disableIpV6Only()
    End Sub

    Public Sub New(ByVal port As Int32)
        MyBase.New(IPAddress.IPv6Any, port)
        disableIpV6Only()
    End Sub

    Public Sub New(ByVal localaddr As IPAddress, ByVal port As Int32)
        MyBase.New(localaddr, port)
        disableIpV6Only()
    End Sub
#End If

    Public Sub New(ByVal localEP As IPEndPoint)
        MyBase.New(localEP)
    End Sub

    Public Sub New(ByVal port As Int32)
        MyBase.New(IPAddress.Any, port)
    End Sub

    Public Sub New(ByVal localaddr As IPAddress, ByVal port As Int32)
        MyBase.New(localaddr, port)
    End Sub

    Public Shadows Function Active() As Boolean
        Return MyBase.Active()
    End Function
End Class
